import React, { Component } from 'react'
import { navigatorMap } from '../../../../configFile'

interface IProps {
    toPage(path: string): void
    path: string
    selected: boolean
}
export default class NavItem extends Component<IProps> {
    handleClick = () => {
        this.props.toPage(this.props.path)
    }
    render() {
        return (
            <li className={this.props.selected ? 'NaviBarItemSelected' : 'NaviBarItem'} onClick={this.handleClick}>{navigatorMap[this.props.path]}</li>
        )
    }
}
